<?xml version='1.0' encoding='UTF-8' ?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"
	xmlns:h="http://java.sun.com/jsf/html"
	xmlns:p="http://primefaces.org/ui"
	xmlns:f="http://java.sun.com/jsf/core"
	xmlns:ui="http://java.sun.com/jsf/facelets">

<p:panel header="FINALIZAR CONTRATO">
	<p:messages globalOnly="true" />
    
    <h:form id="finalizarContrato">
    <p:growl id="growl" showDetail="true" life="3000"  /> 
	<h:inputHidden value="#{contratoBean.contratoConsultado}"/>
	<h:panelGrid columns="2" cellpadding="10">
		<h:outputText value="Data Atual:" />
		<h:outputText value="#{contratoBean.dataAtual.time}" >
			<f:convertDateTime pattern="dd/MM/yyyy" />
		</h:outputText>
		
	   	<h:outputText value="Projeto:" />
		<h:outputText value="#{contratoBean.contratoConsultado.projeto.nome}" />
    	<h:outputText value="Freelancer:" />
		<h:outputText
			value="#{contratoBean.contratoConsultado.freelancer.nome}" />

	</h:panelGrid>

	<!--  Panel para o rótulo, mensagem e campo: Lance -->
	<h:panelGrid columns="1" cellpadding="3">
		<h:panelGrid columns="2">
			<h:outputText value="Nota:" />
			<p:message for="nota" />
		</h:panelGrid>
         <h:outputText style="font-weight:bold;" value="#{contratoBean.contratoConsultado.avaliacao.nota}" />
		<p:selectOneMenu id="nota" rendered="#{contratoBean.contratoConsultado.aberto}"
			value="#{contratoBean.avaliacao.nota}" required="true" requiredMessage="Precisa ser informado(a)">
			<f:selectItem itemLabel="-- Selecione --" noSelectionOption="true" />
			
			<f:selectItems value="#{notaBean.notas}" var="nota"
				itemValue="#{nota}" itemLabel="#{nota}" />

		</p:selectOneMenu>

	</h:panelGrid>


	<!--  Panel para o rótulo, mensagem e campo: Lance -->
	<h:panelGrid columns="1" cellpadding="3">
		<h:panelGrid columns="2">
			<h:outputText value="Comentário:" />
			<p:message for="comentario" />
		</h:panelGrid>

		<p:inputTextarea id="comentario" cols="70" rows="5"
			value="#{contratoBean.avaliacao.comentario}" />

	</h:panelGrid>
	<div style="text-align:center;">
			<p:commandButton
							
							id="btConcluir" value="Finalizar" update="@form,:tabPerfil:formContratos"
							action="#{contratoBean.finalizarContrato()}" ajax="false" oncomplete="fecharContratoDialog.hide();"/>
			<p:commandButton update="@this" value="Voltar" onclick="fecharContratoDialog.hide();"/>
	
	</div>

	</h:form>

</p:panel>



</html>